package com.xxx.mch.domain.po;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    @Id
    private Integer uid;

    @Column(name = "avatar_url")
    private String avatarUrl;

    @Column(name = "create_time")
    private Date createTime;

    private String deleted;

    @Column(name = "nick_name")
    private String nickName;

    @Column(name = "parent_id")
    private Integer parentId;

    @Column(name = "login_name")
    private String loginName;

    /**
     * 数组
     */
    private String roles;

    @Column(name = "user_code")
    private String userCode;

    @Column(name = "user_uncode")
    private String userUncode;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 第三方部门ID
     */
    @Column(name = "dept_id")
    private Integer deptId;

    private String disabled;

    @Column(name = "disabled_time")
    private Date disabledTime;

    private String email;

    @Column(name = "extend_attributes")
    private String extendAttributes;

    @Column(name = "failed_count")
    private String failedCount;

    /**
     * 数组
     */
    @Column(name = "user_groups")
    private String groups;

    private String link;

    private Integer operate;

    /**
     * 数组
     */
    private String organizations;

    /**
     * 数组
     */
    private String permissions;

    private String phone;

    @Column(name = "pwd_change_time")
    private Date pwdChangeTime;

    @Column(name = "s3accesskey_id")
    private String s3accesskeyId;

    @Column(name = "site_code")
    private String siteCode;

    @Column(name = "site_name")
    private String siteName;

    @Column(name = "site_type")
    private Integer siteType;

    @Column(name = "storage_object_count")
    private String storageObjectCount;

    @Column(name = "storage_size")
    private Double storageSize;

    @Column(name = "storage_usage")
    private String storageUsage;

    @Column(name = "storage_warning_PCT")
    private String storageWarningPct;

    private String templates;

    private Integer type;

    @Column(name = "user_token")
    private String userToken;

    public boolean equals(Object obj) {
        if (obj instanceof User) {
            User user = (User)obj;
            return this.getUserCode() != null && this.getUserCode().equals(user.getUserCode());
        }
        return false;
    }


}